﻿@{
    ViewBag.Title = "Home";
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
}
<!-- book room start -->
<!-- book room end -->
<!-- room details start -->
<div class="row home-content">
    <div class="col-md-4">
        <section class="room-type">
            <a>
                <img src="~/Content/Default/Images/home_rt_standard.jpg" />
            </a>
            <h5>Standard Room <strong>Rs. 7,200</strong></h5>
            <p>
                At the middle of the property, all standard rooms have amazing view with all necessary
                amenities.
            </p>
            <ul class="facilities">
                <li>
                    <a class="ico-water protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Mineral/RO Water"></a>
                </li>
                <li>
                    <a class="ico-tea protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Tea/Coffee Maker"></a>
                </li>
                <li>
                    <a class="ico-food protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Lunch/Dinner"></a>
                </li>
                <li>
                    <a class="ico-converters protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="220V-110 V Converters">
                    </a>
                </li>
                <li>
                    <a class="ico-wifi protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Wifi/Internet Connection"></a>
                </li>
                <li>
                    <a class="ico-restroom protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Rest Room"></a>
                </li>
            </ul>
        </section>
    </div>
    <div class="col-md-4">
        <section class="room-type">
            <a>
                <img src="~/Content/Default/Images/home_rt_superior.jpg" />
            </a>
            <h5>Superior Room <strong>Rs. 8,100</strong></h5>
            <p>
                Completely wooden, carved out of pure wood and a complete delight overlooking Dauladhar
                mountain range. The view from each room is breath taking.
            </p>
            <ul class="facilities">
                <li>
                    <a class="ico-water protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Mineral/RO Water"></a>
                </li>
                <li>
                    <a class="ico-tea protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Tea/Coffee Maker"></a>
                </li>
                <li>
                    <a class="ico-food protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Lunch/Dinner"></a>
                </li>
                <li>
                    <a class="ico-converters protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="220V-110 V Converters">
                    </a>
                </li>
                <li>
                    <a class="ico-wifi protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Wifi/Internet Connection"></a>
                </li>
                <li>
                    <a class="ico-restroom protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Rest Room"></a>
                </li>
            </ul>
        </section>
    </div>
    <div class="col-md-4">
        <section class="room-type">
            <a>
                <img src="~/Content/Default/Images/home_rt_cottage.jpg" />
            </a>
            <h5>Cottage <strong>Rs. 9,000</strong></h5>
            <p>
                Completely wooden, carved out of pure wood and exclusively overlooking the river
                at the back and snow capped mountains at the front. Complete exclusivity and privacy.
            </p>
            <ul class="facilities">
                <li>
                    <a class="ico-water protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Mineral/RO Water"></a>
                </li>
                <li>
                    <a class="ico-tea protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Tea/Coffee Maker"></a>
                </li>
                <li>
                    <a class="ico-food protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Lunch/Dinner"></a>
                </li>
                <li>
                    <a class="ico-converters protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="220V-110 V Converters">
                    </a>
                </li>
                <li>
                    <a class="ico-wifi protext" href="javascript:void(0)" data-container="body" data-toggle="popover"
                       data-placement="bottom" data-content="Wifi/Internet Connection"></a>
                </li>
                <li>
                    <a class="ico-restroom protext" href="javascript:void(0)" data-container="body"
                       data-toggle="popover" data-placement="bottom" data-content="Rest Room"></a>
                </li>
            </ul>
        </section>
    </div>
</div>
<!-- room details end -->
<!-- new year bonanza start -->
<!-- Button trigger modal -->
@*<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
        Launch demo modal
    </button>*@

<!-- Modal -->
<div class="modal" id="bonanza" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            @*<div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            </div>*@
            <div class="modal-body">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <a href="https://drive.google.com/file/d/0B6725uNwF-jnLUhXVjdfYW1GUnc/view?usp=sharing" target="_blank"><img src="~/Content/Default/Images/bonanza.png" /></a>
            </div>
        </div>
    </div>
</div>
<!-- new year bonanza end -->
<script type="text/javascript">



    $(document).ready(function () {
    var dateToday = new Date();
        var dates = $("#CheckInDate, #CheckOutDate").datepicker({
            dateFormat: "dd/mm/yy",
            minDate: dateToday,
            onSelect: function (selectedDate) {
                var option = this.id == "CheckInDate" ? "minDate" : "maxDate",
                    instance = $(this).data("datepicker"),
                    date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
                dates.not(this).datepicker("option", option, date);
            }
        });
    });
    $.getScript("/Scripts/jquery.validate.js")
    function ValidateandSubmit() {
        $("form[id='BookingFrom']").validate({
            debug: true,
            rules: {
                roomType: { required: true },
                CheckInDate: { required: true },
                CheckOutDate: { required: true },
                Adult: { required: true },
                Children: { required: true },
            },
            submitHandler: function (form) {
                postData();
            }
        });
    }
    function postData() {
                var form = $("#BookingFrom");
                if (form.valid()) {
                    submitForm();
                }
            }

        function submitForm() {
            var roomType = $("#roomType :selected").text();
            var CheckInDate = $("#CheckInDate").val();
            var CheckOutDate = $("#CheckOutDate").val();
            var noOfAdults = $("#Adult :selected").text();
            var noOfChildren = $("#Children :selected").text();
            var ob = new Object();
            ob.RoomType = roomType;
            ob.s_checkInDate = CheckInDate;
            ob.s_checkoutDate = CheckOutDate;
            ob.noOfAdults = noOfAdults;
            ob.noOfChildren = noOfChildren;

            $.ajax({
                type: 'POST',
                contentType: "application/json",
                data: JSON.stringify(ob),
                cache: false,
                url: '/Home/BookNow',
                success: function (data) {
                    location.href = "/Tariff/BookingRoom";
                }
            });
        }
</script>
